import { manageList,getRequest } from "@/api/clinic/manage.js"

/**
 * 全局配置 manage
 * 会诊病例 的 store
 */

const manageStore = defineStore(
    'manage',
    {
        state: () => {
            return{
                condition:{
                    expert_id:'',
                    case_no:'',
                    name:'',
                    start:'',
                    end:'',
                    status:'',

                    page:1,
                    rows:5,
                    total: '' ,
                    // currentPage:4,
                    // pageSize:100,
                    small:false,
                    backround:false,
                    disabled:false
                },
                list:reactive([]),
                // typelist : proxy.useDict("deal_status")
            }
        },
        actions:{
            show(state){
                console.log(state.condition);
            },
            emrcaselist(state){
                console.log(state.condition) ;
                 getRequest("/emr/emrcaselist",state.condition).then(resp=>{
                    if(resp){
                        console.log(resp);
                        console.log(resp.data.data.list);
                        this.list=resp.data.data.list ;
                        this.condition.total = resp.data.data.total ;
                    }
                 }) ;
            }
        },
        getters:{

        }
    }
)

export default manageStore ;